import { RouteRecordRaw } from 'vue-router'
import { asyncRoutes } from './asyncRoutes'

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/dashboard',
    component: () => import('../components/layout/Layout.vue'),
    children: asyncRoutes
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/403',
    name: '403',
    component: () => import('../views/403.vue')
  },
  {
    path: '/404',
    component: () => import('../views/404.vue')
  },
  //这个*匹配必须放在最后，将改路由配置放到所有路由的配置信息的最后，否则会其他路由path匹配造成影响。
  {
    path: '/:pathMatch(.*)',
    redirect: '/404'
  }
]
